POV-Ray : Newsgroups : povray.general : Meshes and Textures : Re: Meshes and Textures Server Time
12 Aug 2024 03:24:35 EDT (-0400)
  Re: Meshes and Textures  
From: Ken
Date: 29 Mar 1999 07:59:02
Message: <36FF5BEE.125FA5AA@pacbell.net>
********  Welcome to the world origin concept.  ********** 

Gordon wrote:
> Thanks Ken, but I think you may of misunderstood my description. I will
> illustrate with an example.
> 
> #declare Fred = mesh{
> triangle { <1,1,1>, <1,1,1.5>,<1,1.5,1> texture {T0} }
> triangle { <2,1,1>, <2,1,1.5>,<2,1.5,1> texture {T1} }
> }
> 
> object { Fred } // This one is OK
> object { Fred rotate <0,0,45> } // This one is not the same as the other
> one! The textures have rotated (I think) 45 degrees the oposite direction to
> the mesh.
> 
> Does this make sense?
> 
> Gordon
> <gbe### [at] birdcameroncomau>
> 
> I

   No I understood you completely. If you take the time to
 render the following example I believe you will find that
 it unquestionably supports my earlier claims. I rearranged
 your two triangle example because your triangle mesh didn't
 have any common vertice locations. The way they are positioned
 now is in keeping with your problem and shows the only method
 I know of to adhere to the present system of a zero origin
 and not have your textures move when translated, rotated, or
 both.

  I am not saying that it is a perfect system but if you adhere
 to it's rules it will perform reliably and predictably.

  camera{location<0,.5,-6>look_at<0,.5,0>}

  light_source{<0,0,-10>rgb 1}

  #declare T1 = 
  texture{ pigment { gradient x+y color_map {
  [0.00 rgb<1,1,1>][0.40 rgb<1,1,1>][0.40 rgb<1,0,0>]
  [0.60 rgb<1,0,0>][0.60 rgb<1,1,1>][1.00 rgb<1,1,1>]}scale 0.5}
  finish{ambient 0.35 diffuse 0.35}}

  // The method you were using
  #declare Fred1 = 
  mesh     {
  triangle { <-1,1,0>,<0,0,0>,<1,1,0> texture{T1}}
  triangle { <-1,1,0>,<0,2,0>,<1,1,0> texture{T1}}
           }

  // By the book method
  #declare Fred2 = 
  union    {
  triangle { <-1, 0.5,0>,<0,-0.5,0>,<1, 0.5,0>texture{T1}translate y*-0.5}
  triangle { <-1,-0.5,0>,<0, 0.5,0>,<1,-0.5,0>texture{T1}translate y* 0.5}
           }

  object   { Fred1 rotate  0*y translate < 0.0,-1.75,0> }
  object   { Fred1 rotate 45*x translate <-2.5,-1.75,0> }
  object   { Fred1 rotate 65*y translate < 2.5,-1.75,0> }

  object   { Fred2 rotate  0*y translate < 0.0, 1.75,0> }
  object   { Fred2 rotate 45*x translate <-2.5, 1.75,0> }
  object   { Fred2 rotate 65*y translate < 2.5, 1.75,0> }


Regards,

-- 
Ken Tyler

mailto://tylereng@pacbell.net


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.